package com.it.sun.yuebike.common.controller;

import com.it.sun.yuebike.framework.model.dto.Result;
import com.it.sun.yuebike.framework.util.MinioUtils;
import com.it.sun.yuebike.framework.util.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName com.it.sun.yuebike.common.controller.HomeController
 * @Author sunmannian
 * @Date 2021/5/31 14:18
 * @Version V1.0
 * Description  <请输入一句话描述该类功能>
 * Copyright (C) 北京中电兴发科技有限公司  since 2021/5/31
 */
@RestController
@RequestMapping("/home")
@Api(tags = "入口服务")
public class HomeController {


    @ApiOperation("首页")
    @GetMapping("/index")
    public Result<String> home() {

        return ResultUtils.success("11111");
    }

    @ApiOperation("上传")
    @PostMapping("/download")
    public Result<String> home(MultipartFile file) {
        String upload = MinioUtils.upload(file, "yue-bike");
        return ResultUtils.success(upload);
    }
}



